package com.zy.composeworld.base.bean

import android.view.View

class BaseMenuBean {
    var type = COMMON  //内部展示样式
    val des: String

    var code = 0
        private set

    var click: ((view: View) -> Unit)? = null

    var clickWithCode: ((view: View, code: Int) -> Unit)? = null

    constructor(des: String, click: ((view: View) -> Unit)?) {
        this.des = des
        this.click = click
        if (click == null) {
            type = HEAD
        }
    }

    constructor(des: String, code: Int, clickWithCode: ((view: View, code: Int) -> Unit)?) {
        this.des = des
        this.code = code
        this.clickWithCode = clickWithCode
    }

    constructor(des: String, code: Int) {
        this.des = des
        this.code = code
    }

    constructor(des: String) {
        this.des = des
        type = HEAD
    }

    companion object {
        var COMMON = 0
        var HEAD = 1
    }
}